package tree_util;

import com.opensymphony.xwork2.ActionSupport;
import db_tool.DbBean;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

public class ReplayRequest extends ActionSupport{
  private String list;
  private String agreeName;
  public String saveReplay(){
	  String replay;
	  System.out.println(list+" dddddddddddddddd11");
	  PrintWriter out = null;
	try {
		out = ServletActionContext.getResponse().getWriter();
	} catch (IOException e) {
		e.printStackTrace();
	}
	  HttpSession session = ServletActionContext.getRequest().getSession();
	  String []agree = list.split(",");
	  System.out.println(agree.length+"    am ");
	  ArrayList<String> datas = (ArrayList<String>)session.getAttribute("datas");
	  System.out.println(datas+" aaaa   nnn");
	  DbBean db = new DbBean();
	  replay = db.executeReplay(datas, agree,agreeName);	  
	  out.write(replay);
	  return null;
  }
  
  public String getList(){
	  return list;
  }
  
  public void setList(String list){
	  this.list = list;
  }
  
  public String getAgreeName(){
	  return agreeName;
  }
  
  public void setAgreeName(String agreeName){
	  this.agreeName = agreeName;
  }

}
